﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CarLoanSystemWeb.MasterPage;
using CarLoanSystem.Comman;

namespace CarLoanSystemWeb.Page.EditProfile
{
    public partial class EditProfilePage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            wuc_edit_profile1.InfoMessege += new EventHandler(Call_InfoMessage);
            wuc_edit_profile1.ErrorMessege += new EventHandler(Call_ErrorMessage);
        }

        private void Call_InfoMessage(object sender, EventArgs e)
        {
            InfoMessage("แก้ไขข้อมูลเรียบร้อยแล้ว");
            Response.AppendHeader("Refresh", "2; url=../Main/MainPage.aspx");
        }

        private void Call_ErrorMessage(object sender, EventArgs e)
        {
            ErrorMessage(sender.ToString());
        }

        private void InfoMessage(string msg)
        {
            ((MainMasterPage)this.Master).ShowInfoMessage(msg);
        }

        private void ErrorMessage(string msg)
        {
            ((MainMasterPage)this.Master).ShowErrorMessage(msg);
        }
    }
}